package botcraft.game;

import java.util.Set;

public class Team {
	private final String name;
	private final Set<Player> players;
	
	public Team(final String name, final Set<Player> players) {
		if (name == null)
			throw new IllegalArgumentException("Team name can not be null");
		if (players == null)
			throw new IllegalArgumentException("Team players can not be null");
		this.name = name;
		this.players = players;
	}
	
	public String getName() {
		return name;
	}
	
	public Set<Player> getPlayers() {
		return players;
	}
	
	@Override
	public boolean equals(final java.lang.Object object) {
		return (object instanceof Team) && name.equals(((Team) object).name);
	}
	
	@Override
	public int hashCode() {
		return name.hashCode();
	}
	
	@Override
	public String toString() {
		return name;
	}
}
